package com.taobao.txc.resourcemanager.a;

import com.taobao.txc.common.LoggerInit;
import com.taobao.txc.common.LoggerWrap;
import com.taobao.txc.common.TxcContext;
import com.taobao.txc.common.config.o;

public class c<T>
{
  private static final LoggerWrap a = LoggerInit.logger;
  private final com.taobao.txc.resourcemanager.b.b.a.a<T> b;
  
  public c(com.taobao.txc.resourcemanager.b.b.a.a<T> parama)
  {
    this.b = parama;
  }
  
  private com.taobao.txc.resourcemanager.a.a.b<T> a(com.taobao.txc.resourcemanager.b.a.a parama, com.taobao.txc.resourcemanager.b.a.d paramd)
  {
    com.taobao.txc.parser.b.a.g localg = com.taobao.txc.parser.b.b.b(paramd.g());
    Object localObject = null;
    switch (d.a[localg.j().d().ordinal()])
    {
    case 1: 
      localObject = new com.taobao.txc.resourcemanager.a.e.b(parama, paramd, this.b, localg);
      break;
    case 2: 
      localObject = new com.taobao.txc.resourcemanager.a.e.d(parama, paramd, this.b, localg);
      break;
    case 3: 
      localObject = new com.taobao.txc.resourcemanager.a.e.e(parama, paramd, this.b, localg);
      break;
    case 4: 
      break;
    case 5: 
      localObject = new com.taobao.txc.resourcemanager.a.e.c(parama, paramd, this.b, localg);
      break;
    }
    return localObject;
  }
  
  private com.taobao.txc.resourcemanager.a.a.b<T> b(com.taobao.txc.resourcemanager.b.a.a parama, com.taobao.txc.resourcemanager.b.a.d paramd)
  {
    com.taobao.txc.parser.b.a.g localg = com.taobao.txc.parser.b.b.b(paramd.g());
    Object localObject = null;
    switch (d.a[localg.j().d().ordinal()])
    {
    case 6: 
      if ((com.taobao.txc.parser.hint.a.b(localg.j().a()) == true) || (com.taobao.txc.parser.hint.a.b(TxcContext.k() + localg.j().a()))) {
        localObject = new com.taobao.txc.resourcemanager.a.b.g(parama, paramd, this.b, localg);
      }
      break;
    case 7: 
      localObject = new com.taobao.txc.resourcemanager.a.b.f(parama, paramd, this.b, localg);
      break;
    case 1: 
      localObject = new com.taobao.txc.resourcemanager.a.b.c(parama, paramd, this.b, localg);
      break;
    case 2: 
      localObject = new com.taobao.txc.resourcemanager.a.b.e(parama, paramd, this.b, localg);
      break;
    case 3: 
      localObject = new com.taobao.txc.resourcemanager.a.b.h(parama, paramd, this.b, localg);
      break;
    case 4: 
      break;
    case 5: 
      localObject = new com.taobao.txc.resourcemanager.a.b.d(parama, paramd, this.b, localg);
      break;
    }
    return localObject;
  }
  
  private com.taobao.txc.resourcemanager.a.a.b<T> c(com.taobao.txc.resourcemanager.b.a.a parama, com.taobao.txc.resourcemanager.b.a.d paramd)
  {
    com.taobao.txc.parser.b.a.g localg = com.taobao.txc.parser.b.b.b(paramd.g());
    com.taobao.txc.resourcemanager.a.c.a locala = null;
    switch (d.a[localg.j().d().ordinal()])
    {
    case 1: 
    case 2: 
    case 3: 
      locala = new com.taobao.txc.resourcemanager.a.c.a(parama, paramd, this.b);
      break;
    }
    return locala;
  }
  
  private com.taobao.txc.resourcemanager.a.a.b<T> d(com.taobao.txc.resourcemanager.b.a.a parama, com.taobao.txc.resourcemanager.b.a.d paramd)
  {
    if (!TxcContext.j()) {
      throw com.taobao.txc.common.b.c.a(new com.taobao.txc.common.b.c("not in txc env!"));
    }
    if ((TxcContext.inTxcTransaction()) && (TxcContext.g())) {
      throw com.taobao.txc.common.b.c.a(new com.taobao.txc.common.b.c("Both in AT/MT & RT is not support!"));
    }
    com.taobao.txc.resourcemanager.a.a.b localb = null;
    if (TxcContext.inTxcTransaction())
    {
      com.taobao.txc.common.h localh = o.a().g(com.taobao.txc.a.b.g.f());
      switch (d.b[localh.ordinal()])
      {
      case 1: 
        localb = a(parama, paramd);
        break;
      case 2: 
        localb = b(parama, paramd);
        break;
      case 3: 
        throw com.taobao.txc.common.b.c.a(new com.taobao.txc.common.b.c("repeatable isolation is not supported."));
      case 4: 
        throw com.taobao.txc.common.b.c.a(new com.taobao.txc.common.b.c("serializable isolation is not supported."));
      default: 
        throw com.taobao.txc.common.b.c.a(new com.taobao.txc.common.b.c("unknown isolation."));
      }
    }
    else if (TxcContext.g())
    {
      localb = c(parama, paramd);
    }
    return localb == null ? new a(parama, paramd, this.b, null) : localb;
  }
  
  public T a(com.taobao.txc.resourcemanager.b.a.a parama, com.taobao.txc.resourcemanager.b.a.d paramd, String paramString, Object... paramVarArgs)
  {
    try
    {
      if ((paramd instanceof com.taobao.txc.resourcemanager.b.a.c))
      {
        localObject1 = (com.taobao.txc.resourcemanager.b.a.c)paramd;
        a.info(String.format("[start] [%s] [%s] [%d] [%s] [%s] [%s] [%s] [%s] [%s] [%s]", new Object[] { com.taobao.txc.a.b.g.f(), paramString, Long.valueOf(TxcContext.d()), f.a(parama), f.b(parama), ((com.taobao.txc.resourcemanager.b.a.c)localObject1).g(), ((com.taobao.txc.resourcemanager.b.a.c)localObject1).d(), TxcContext.k(), TxcContext.l(), ((com.taobao.txc.resourcemanager.b.a.c)localObject1).h() }));
      }
      else
      {
        a.info(String.format("[start] [%s] [%s] [%d] [%s] [%s] [%s] [%s]", new Object[] { com.taobao.txc.a.b.g.f(), paramString, Long.valueOf(TxcContext.d()), f.a(parama), f.b(parama), paramd.g(), paramd.h() }));
      }
      Object localObject1 = d(parama, paramd);
      a.info(String.format("[parse] [%d] [%s] [%s]", new Object[] { Long.valueOf(TxcContext.d()), localObject1.getClass().getName(), paramd.h() }));
      Object localObject2 = ((com.taobao.txc.resourcemanager.a.a.b)localObject1).a(paramVarArgs);
      return localObject2;
    }
    finally
    {
      a.info(String.format("[end] [%d] [%s]", new Object[] { Long.valueOf(TxcContext.d()), paramd.h() }));
    }
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.resourcemanager.a.c
 * JD-Core Version:    0.7.0.1
 */